package com.veryGood.controller;

import com.veryGood.common.result.R;
import com.veryGood.service.PrintManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 南宫
 * @version 1.0
 * @date 2024-01-28 下午3:20
 */

@RestController
@RequestMapping("/print")
public class PrintManageController {

    @Autowired
    private PrintManageService printManageService;

    @GetMapping("/ruku")
    public R queryrukuDan(@RequestParam(required = false) Integer page, @RequestParam(required = false) Integer limit) {
        System.out.println("con"+page);
        System.err.println("con"+limit);
        if(page<=0){
            page=1;
            limit=5;
        }
        return printManageService.getAllrukuDan(page,limit);
    }

    @GetMapping("/chuku")
    public R querychukuDan(@RequestParam(required = false) Integer page,@RequestParam(required = false) Integer limit) {
        System.out.println("con"+page);
        System.err.println("con"+limit);
        if(page<=0){
            page=1;
            limit=5;
        }
        return printManageService.getAllchukuDan(page,limit);
    }
}
